/**
 * Created by Administrator on 2016/8/17 0017.
 */
Vue.component('condition', {
  template: '#condition-temp',
  props: ['filterText']
});

Vue.component('list', {
  template: '#list-temp',
  props: ['items']
})

Vue.component('filter-list', {
  template: '#filter-list-temp',
  data: function() {
    return {
      filterText: '',
      items: ['Jack Yang','Angel','New York']
    }
  },
  computed: {
    filteredItems: function() {
      return this.$data.items.filter(function(item) {
        return item.indexOf(this.$data.filterText) != -1;
      }.bind(this));
    }
  }
})

new Vue({
  el: '#app'
})
